from sls_controller.sls_entity import EntityUpdate

#UGV.............................................
class UGVBasicPositionEntityUpdate(EntityUpdate):
    def get_pub_topic(self):
        return "/status/"+self.id+"/BP" 
    
    def get_dict_data(self):
        if self.public_resource.ugv_resource.get_gps_position() is not None:
            return {
                "GNSS_position": {"longitude":self.public_resource.ugv_resource.get_gps_position()["longitude"],
                                  "latitude":self.public_resource.ugv_resource.get_gps_position()["latitude"],},
                "vehicle_yaw": self.public_resource.ugv_resource.get_gps_yaw()/57.3
            }
        else:
            print("UGV GPS is None")
            return {
                "GNSS_position": None,
                "vehicle_yaw": None
            }